package cn.zm.trip.web.domain;

import lombok.Data;

/**
 * 留言统计
 */
@Data
public class WordStatisticsEntity {

    /**
     * 得分
     */
    private Integer score;

    /**
     * 每个分数的个数
     */
    private Integer quantity;

    /**
     * 得分比例 = quantity / 总得分个数
     */
    private Double scoreRatio;

    /**
     * 比例拼接百分号，方便jsp展示
     */
    private String scoreRatioText;

    /**
     * 得分文字表示，方便jsp展示，倒序，从上到下一次显示极佳，非常好，一般，较差，非常差
     */
    private String scoreText;

    public void setScoreTextByScore() {
        switch (score) {
            case 1:
                scoreText = "非常差";
                break;
            case 2:
                scoreText = "较差";
                break;
            case 3:
                scoreText = "一般";
                break;
            case 4:
                scoreText = "非常好";
                break;
            case 5:
                scoreText = "极佳";
                break;
            default:
                scoreText = "未知";
                break;
        }
    }
}
